
/**
 * Please modify this class to meet your needs
 * This class is not complete
 */

package com.gaoxk.cxf.service.s20022000016;

import com.gaoxk.cxf.service.s20022000016.Rsp2002200001673Type;
import com.gaoxk.cxf.service.s20022000016.RspAppHeadType;
import com.gaoxk.cxf.service.s20022000016.RspLocalHead1Type;
import com.gaoxk.cxf.service.s20022000016.RspSysHeadType;

import java.net.InetAddress;
import java.net.UnknownHostException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.xml.bind.annotation.XmlSeeAlso;

/**
 * This class was generated by Apache CXF 3.4.4
 * 2025-09-26T16:34:28.515+08:00
 * Generated source version: 3.4.4
 *
 */
@Service(value = "ESBServerSoapEndpointImpl3")
@WebService(
                      serviceName = "S20022000016",
                      portName = "ESBServerSoapEndpoint",
                      targetNamespace = "http://esb.dcitsbiz.com/services/20022000016/wsdl",
                      wsdlLocation = "classpath:wsdl/20022000016/20022000016.wsdl",
                      endpointInterface = "com.gaoxk.cxf.service.s20022000016.ESBServerPortType")
@Scope(value = "prototype")   //多实例的
//@Scope(value = "singleton")  //单例
public class ESBServerSoapEndpointImpl implements ESBServerPortType {

    private static final Logger logger = LoggerFactory.getLogger(ESBServerSoapEndpointImpl.class.getName());

    /* (non-Javadoc)
     * @see com.gaoxk.cxf.service.s20022000016.ESBServerPortType#op72(com.gaoxk.cxf.service.s20022000016.Req2002200001672Type req2002200001672)*
     */
    public com.gaoxk.cxf.service.s20022000016.Rsp2002200001672Type op72(Req2002200001672Type req2002200001672) {
        logger.info("Executing operation op72");
        System.out.println(req2002200001672);
        try {
            com.gaoxk.cxf.service.s20022000016.Rsp2002200001672Type _return = null;
            return _return;
        } catch (java.lang.Exception ex) {
            ex.printStackTrace();
            throw new RuntimeException(ex);
        }
    }

    /* (non-Javadoc)
     * @see com.gaoxk.cxf.service.s20022000016.ESBServerPortType#op73(com.gaoxk.cxf.service.s20022000016.Req2002200001673Type req2002200001673)*
     */
    public com.gaoxk.cxf.service.s20022000016.Rsp2002200001673Type op73(Req2002200001673Type req2002200001673) {
        logger.info("Executing operation op73");
        System.out.println(req2002200001673);

            try {
                Rsp2002200001673Type resp = new Rsp2002200001673Type();
                //sysHead组装
                com.gaoxk.cxf.service.s20022000016.RspSysHeadType rspSysHeadType = new RspSysHeadType();
                rspSysHeadType.setReqSeq(req2002200001673.getReqSysHead().getReqSeq()==null?"":req2002200001673.getReqSysHead().getReqSeq());
                rspSysHeadType.setChannelID(req2002200001673.getReqSysHead().getChannelID()==null?"":req2002200001673.getReqSysHead().getChannelID());
                rspSysHeadType.setReqTime(req2002200001673.getReqSysHead().getReqTime()==null?"":req2002200001673.getReqSysHead().getReqTime());
                rspSysHeadType.setReqSysID(req2002200001673.getReqSysHead().getReqSysID()==null?"":req2002200001673.getReqSysHead().getReqSysID());
                rspSysHeadType.setReqDate(req2002200001673.getReqSysHead().getReqDate()==null?"":req2002200001673.getReqSysHead().getReqDate());
                rspSysHeadType.setDomainRef(req2002200001673.getReqSysHead().getDomainRef()==null?"":req2002200001673.getReqSysHead().getDomainRef());
                rspSysHeadType.setAcceptLang(req2002200001673.getReqSysHead().getAcceptLang()==null?"":req2002200001673.getReqSysHead().getAcceptLang());
                rspSysHeadType.setGlobalSeq(req2002200001673.getReqSysHead().getGlobalSeq()==null?"":req2002200001673.getReqSysHead().getGlobalSeq());
                rspSysHeadType.setOrgSysID(req2002200001673.getReqSysHead().getOrgSysID()==null?"":req2002200001673.getReqSysHead().getOrgSysID());
                rspSysHeadType.setSvcScn(req2002200001673.getReqSysHead().getSvcScn()==null?"":req2002200001673.getReqSysHead().getSvcScn());
                rspSysHeadType.setLegOrgID(req2002200001673.getReqSysHead().getLegOrgID()==null?"":req2002200001673.getReqSysHead().getLegOrgID());
                rspSysHeadType.setServiceID(req2002200001673.getReqSysHead().getServiceID()==null?"":req2002200001673.getReqSysHead().getServiceID());
                try {
                    rspSysHeadType.setDomainRef(InetAddress.getLocalHost().getHostAddress());
                } catch (UnknownHostException e) {

                    logger.error("获取本机IP异常",e);
                    e.printStackTrace();
                }

                //组装AppHeader
                com.gaoxk.cxf.service.s20022000016.RspAppHeadType rspAppHeadType = new RspAppHeadType();
                rspAppHeadType.setBrId(req2002200001673.getReqAppHead().getBrId()==null?"":req2002200001673.getReqAppHead().getBrId());
                rspAppHeadType.setTlrNo(req2002200001673.getReqAppHead().getTlrNo()==null?"":req2002200001673.getReqAppHead().getTlrNo());
                resp.setRspAppHead(rspAppHeadType);

                //组装local头
                RspLocalHead1Type rspLocalHeadType = new RspLocalHead1Type();
                rspLocalHeadType.setRETCODE("000000");
                rspLocalHeadType.setRETMSG("");
                rspLocalHeadType.setSEQNO("");
                rspLocalHeadType.setTRANDATE("");
                rspLocalHeadType.setTRANTIME("");
                rspLocalHeadType.setTRANSTATUS("");


                resp.setRspLocalHead(rspLocalHeadType);


                Rsp2002200001673Type.RspAppBody rspAppBody = new Rsp2002200001673Type.RspAppBody();
                for(int i=0;i<2;i++){
                    Rsp2002200001673Type.RspAppBody.TAIL tail = new Rsp2002200001673Type.RspAppBody.TAIL();
                    tail.setRETCODE("000001");
                    tail.setRETREASON("hahah");
                    tail.setBACKUP0(String.valueOf(i));
                    tail.setBACKUP1("");
                    tail.setBACKUP2("");
                    tail.setBACKUP3("");
                    tail.setBACKUP4("");
                    rspAppBody.getTAIL().add(tail);
                }
                for(int i=10;i<13;i++) {
                    Rsp2002200001673Type.RspAppBody.BODY body = new Rsp2002200001673Type.RspAppBody.BODY();
                    body.setTASKID(String.valueOf(i));
                    body.setCALLTIME("");
                    body.setCONTIDENT("");
                    body.setRESULTT("");
                    body.setBACKUP5("");
                    body.setBACKUP6("");
                    body.setBACKUP7("");
                    body.setBACKUP8("");
                    body.setBACKUP9("");
                    rspAppBody.getBODY().add(body);
                }

                Thread.sleep(50000);

                rspSysHeadType.setRetCode("000000");
                rspSysHeadType.setRetMsg("成功");
                resp.setRspSysHead(rspSysHeadType);
                resp.setRspAppBody(rspAppBody);

            return resp;
        } catch (java.lang.Exception ex) {
            ex.printStackTrace();
            throw new RuntimeException(ex);
        }
    }

}
